<?php

if (empty($this->adminTemplateConfig)) {
    $this->adminTemplateConfig = Zend_Registry::get('config')->template->default->admin;
}

$this->loadTemplate('admin', $this->adminTemplateConfig->template, $this->adminTemplateConfig->page);

$this->placeholder('charset')->set('utf-8');
echo '<?xml version="1.0" encoding="' . $this->placeholder('charset') . '" ?>' . PHP_EOL;
echo $this->doctype() . PHP_EOL;

$contentLanguage = $this->getAdminLanguage();

$this->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=' . $this->placeholder('charset'))
                 ->appendHttpEquiv('Content-Style-Type', 'text/css')
                 ->appendHttpEquiv('Content-Language', $contentLanguage);

?>

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>
            <?php echo $this->getTranslation('My Wedding') . $this->escape($this->title) . PHP_EOL; ?>
        </title>
        <?php

        echo $this->layout()->pageHead;

        echo $this->headMeta() . PHP_EOL;
        echo $this->headLink();

        if ($this->initScript) {
            $this->jQuery()->onLoadCaptureStart();?>
                $('a.delete').bind('click', function() {
                    var answer = confirm('<?php echo $this->getTranslation('Are you sure you want to delete this?') . ' ' . $this->getTranslation('Please be aware that dependent nodes might be deleted as well!'); ?>');
                    if (!answer) {return false;}
                });
                $('a.add_to_my_bookmarks').click(function() {
                    var label = prompt('<?php echo $this->getTranslation('Bookmark label:'); ?>');
                    if (label) {
                        var url = $(this).attr('href');
                        url += '/label/' + label;
                        if (jQuery.get(url)) {
                            alert('<?php echo $this->getTranslation('Your bookmark was successfully saved.'); ?>');
                        }
                    }
                    return false;
                });

            <?php
                $this->jQuery()->onLoadCaptureEnd();
            };
            echo PHP_EOL . $this->jQuery() . PHP_EOL;
        ?>
    </head>

    <body>
    <?php
        echo $this->layout()->template;
    ?>
    </body>
</html>